package com.fofia.iotweb.framework.core;

import org.noear.solon.core.handle.Context;
import org.noear.solon.core.handle.ModelAndView;

import java.util.HashMap;
import java.util.Map;

public class BaseController {

    public ModelAndView view(){
        return new ModelAndView(Context.current().path()+".ftl");
    }
    public ModelAndView view(String title){
        return new ModelAndView(Context.current().path()+".ftl").put("title",title);
    }
    public ModelAndView view(Map<String,Object> model){
        return new ModelAndView(Context.current().path()+".ftl").model(model);
    }


    public Map<String,Object> ViewModel(){
        return new HashMap<String,Object>();
    }
}
